package com.joysuch.wwyt.attendant.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.joysuch.wwyt.attendant.bean.AttendantRecordAppBean;
import com.joysuch.wwyt.attendant.bean.AttendantStayTimeBean;
import com.joysuch.wwyt.attendant.bean.vo.AttendantRecordDetailVo;
import com.joysuch.wwyt.attendant.bean.vo.AttendantRecordPageVo;
import com.joysuch.wwyt.attendant.bean.vo.AttendantRecordTrackVo;
import com.joysuch.wwyt.attendant.entity.AttendantRecord;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @Description //TODO
 * @Date 2023/2/15 11:46
 * @Author Leong
 **/
public interface AttendantRecordMapper extends BaseMapper<AttendantRecord> {

    Page<AttendantRecordPageVo> findPage(@Param("page")Page<AttendantRecordPageVo> page, @Param("userIds")List<Long> userIds,
                                         @Param("planName")String planName, @Param("areaId")Long areaId,
                                         @Param("startTime")Date startTime, @Param("endTime")Date endTime,
                                         @Param("orgCode")String orgCode, @Param("tenentId")Long tenentId);

    Page<AttendantRecordAppBean> selectPage(Page<AttendantRecordAppBean> page, @Param("startTime") Date startTime,
                                            @Param("endTime")Date endTime, @Param("userId") Long userId, @Param("yesterday") Date yesterday);

    AttendantRecord selectByPlanId(Long planId);

    AttendantRecordDetailVo detail(@Param("id")Long id);

    AttendantRecordTrackVo track(@Param("id")Long id);

    List<AttendantStayTimeBean> findNoDuration();

    void updateDuration(@Param("id") Long id,@Param("duration") String duration);
}
